<template>
<div class="content-center">
  <div class="content-cotainer border-box">
    <div class="content-breadcrumb">
      <el-breadcrumb separator="/" class="breadcrumb">
        <el-breadcrumb-item :to="{ path: '/' }">审计报告</el-breadcrumb-item>
        <el-breadcrumb-item>审计报告列表</el-breadcrumb-item>
        <el-breadcrumb-item>报告修改意见</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="audit-content">
      <div class="centent-title">
        <span>{{title}}</span>
      </div>
      <!-- 页面内容 -->
      <div class="centent-inner" style="padding:15px;">
        <div>
          <br>
          <el-table 
           size="mini" 
           :data="tableData" 
           style="width: 100%">
            <el-table-column type="index" label="序号" align="center" ></el-table-column>
            <el-table-column prop="docName" label="审计报告名称" align="center"></el-table-column>
            <el-table-column prop="auditName" label="审核人" align="center" ></el-table-column>
            <el-table-column prop="auditStatus" label="审核状态" align="center">
              <template slot-scope="scope">
                <span v-if="scope.row.auditStatus === 0" style="color:#FFD700">未审批</span>
                <span v-else-if="scope.row.auditStatus === 1" style="color:#009FCC">通过</span>
                <span v-else-if="scope.row.auditStatus === 2" style="color:#FF0000"> 未通过</span>
              </template>
            </el-table-column>
            <el-table-column label="修改意见" align="center">
              <template slot-scope="scope">
                <el-button type="text" @click="selectOpinion(scope.row.docName,scope.row.auditStatus,scope.row.auditName,scope.row.suggestion)">
                <span>查看</span>
                </el-button>
              </template>
            </el-table-column>
          </el-table>
          <!-- 审计报告列表分页 -->
          <el-pagination style="margin-top: 10px;" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage4" :page-sizes="[100, 200, 300, 400]" :page-size="100" layout="total, sizes, prev, pager, next, jumper" :total="400">
          </el-pagination>
        </div>
        <!-- 审核意见-->
        <br>
        <div id="exPara" style="border:1px solid #DDDDDD;
                    height:300px; 
                    overflow: auto;
                    borderRadius:10px;
                    display: none;
                    ">
                    <!-- display:none; -->
          <div class="centent-title">
            <el-row>
              <el-col :span="20">
                <div>
                  <span style="float:left;fontSize:16px;color:#000000;">
                  {{opinion}}{{docName}}
                </span>
                </div>
              </el-col>
              <el-col :span="4">
                <div>
                  <span style="float:left;fontSize:16px;color:#000000;">
                   {{auditStatus}}
                  </span>
                </div>
              </el-col>
            </el-row>
          </div>
          <div style="fontSize:16px;textIndent:30px;color:#888888;">
            <!-- 审核意见 -->
            {{suggestion}}

          </div>
        </div>
        <div>
          
        </div>
      </div>
      
    </div>
  </div>
</div>
</template>

<script>
import axios from 'axios'
export default {
  data() {
    return {
      dis: 'hide',
      title: '报告修改意见',
      opinion: '审核意见: ',
      tableData: [],
      docName:'',
      suggestion:'',
      auditStatus:'',
     // currentPage4：4
    }
  },
  mounted () {
    let auditRptfileId;
    let auditRptfileNm;
    if (this.$route.query.id) {
       auditRptfileId = this.$route.query.id
       auditRptfileNm = this.$route.query.nm
    }
    // 查询审计报告列表
    this.tableData = []
    let info = {
      "userId":"1234",
      "nodeCode":"001110",
      "auditRptfileId": auditRptfileId,
      "auditRptfileNm": auditRptfileNm
    };
    axios.post('http://localhost:7111/syncFromICBC/getAuditOpinion',info).then((response) => {
      if (response.data.auditOpinionBoList){
        this.tableData = response.data.auditOpinionBoList
      }
    }).catch((response) => {
      console.log(response)
    })
  },
  methods: {
  
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
   selectOpinion(docName,auditStatus,auditName,suggestion){
     console.log(111111111)
     document.getElementById("exPara").style.display="";
     this.docName=docName;
     this.suggestion=suggestion
    if (auditStatus == 0) {
       this.auditStatus = "未审批"
     } else if(auditStatus == 1) {
       this.auditStatus = "通过"
     } else{
       this.auditStatus = "未通过"
     }
   }
  }
}
</script>

<style lang="less" scoped>
.content-cotainer {
  padding: 0 20px 20px 20px;
  height: 100%;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}

.bg-purple {
  background: #d3dce6;
}

.my-font-height {
  line-height: 40px;
}
</style>
